﻿// 注释

using EVE.ECS_Model.Client.BCR;
using EVE.ECS_Model.Client.ECS;
using EVE.ECS_Model.Client.HK;
using EVE.ECS_Model.Client.PLC;
using EVE.ECS_Model.Client.Statistic;
using EVE.ECS_Model.Server.Config;
using EVE.ECS_Model.Server.Process;
using EVE.ECS_Model.Server;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GeneralCommon.Models.Connect;
using GeneralCommon.Models.Server;

namespace Admin.EcsWeb.Service.Grpc;
public interface IGrpcService
{
    /// <summary>
    /// 获取PLC数据
    /// </summary>
    /// <param name="searchPlc"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<PushPlcGroup>>> GetPushGroups(SearchPlcModel searchPlc);

    /// <summary>
    /// 获取充放电预约任务
    /// </summary>
    /// <returns></returns>
    Task<GrpcReturn<List<HkWriteInfo>>> GetFmtAppoints();

    /// <summary>
    /// 删除预约缓存数据
    /// </summary>
    /// <param name="write"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> RemoveFmtAppint(HkWriteInfo write);

    /// <summary>
    /// 获取Bcr数据
    /// </summary>
    /// <param name="searchPlc"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<PushBcrGroup>>> GetBcrGroups(SearchPlcModel searchPlc);

    /// <summary>
    /// 获取Hk数据
    /// </summary>
    /// <param name="searchPlc"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<PushHKGroup>>> GetHkGroups(SearchPlcModel searchPlc);



    /// <summary>
    /// 获取设备的UnitTags数据
    /// </summary>
    /// <param name="searchUnit"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<ECSUnitTag>>> GetUnitTags(SearchUnitModel searchUnit);

    /// <summary>
    /// 获取输送线CV数据
    /// </summary>
    /// <param name="searchUnit"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<EcsCvUnit>>> GetCvUnits(SearchUnitModel searchUnit);

    /// <summary>
    /// 清除fmt缓存
    /// </summary>
    /// <param name="groupNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> DeleteFmtCache(int groupNum);
    /// <summary>
    /// 获取输送线SC数据
    /// </summary>
    /// <param name="searchUnit"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<EcsScUnit>>> GetScUnits(SearchUnitModel searchUnit);

    /// <summary>
    /// 获取注册的客户端配置
    /// </summary>
    /// <param name="id"></param>
    /// <param name="name"></param>
    /// <returns></returns>
    Task<GrpcReturn<SignClient>> ConnectAsync(int id, string name);


    /// <summary>
    /// 发送扫码枪读取
    /// </summary>
    /// <param name="searchPlc"></param>
    /// <returns></returns>
    Task<GrpcReturn<bool>> SendBcrRead(SearchPlcModel searchPlc);

    /// <summary>
    /// 发送输送线写入数据
    /// </summary>
    /// <param name="datas"></param>
    /// <returns></returns>
    Task<GrpcReturn<bool>> SendCvWrite(List<PlcCVAddr> datas);

    /// <summary>
    /// 发送堆垛机写入数据
    /// </summary>
    /// <param name="datas"></param>
    /// <returns></returns>
    Task<GrpcReturn<bool>> SendScWrite(List<PlcSCAddr> datas);

    /// <summary>
    /// 堆垛机入库数据
    /// </summary>
    /// <param name="job"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> SendScEnterJob(ScEnterJob job);


    /// <summary>
    /// 堆垛机出库数据
    /// </summary>
    /// <param name="job"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> SendScOutJob(ScOutJob job);

    /// <summary>
    /// 发送杭可设备写入数据
    /// </summary>
    /// <param name="write"></param>
    /// <returns></returns>
    Task<GrpcReturn<bool>> SendHkWrite(HkWriteInfo write);
    /// <summary>
    /// 获取统计信息
    /// </summary>
    /// <returns></returns>
    Task<GrpcReturn<List<GroupRunningData>>> GetGroupStatistic();

    /// <summary>
    /// 获取入库任务
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<ScEnterJob>>> GetEnterJobs(int scNum);
    /// <summary>
    /// 获取移库任务
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<ScMoveJob>>> GetMoveJobs(int scNum);

    /// <summary>
    /// 获取出库任务
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<List<ScOutJob>>> GetOutJobs(int scNum);
    /// <summary>
    /// 移除入库任务和缓存
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> RemoveEnterJob(ScEnterJob scNum);
    /// <summary>
    /// 移除出库任务和缓存
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> RemoveOutJob(ScOutJob scNum);
    /// <summary>
    /// 完成入库任务
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> CompleteEnterJob(ScEnterJob scNum);
    /// <summary>
    /// 完成出库任务
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> CompleteOutJob(ScOutJob scNum);
    /// <summary>
    /// 控制设备
    /// </summary>
    /// <param name="groupData"></param>
    /// <returns></returns>
    Task<ReturnModel<string>> ControlEquip(ConnectGroupData groupData);
    /// <summary>
    /// 移除移库任务
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> RemoveMoveJob(ScMoveJob scNum);
    /// <summary>
    /// 完成移库任务
    /// </summary>
    /// <param name="scNum"></param>
    /// <returns></returns>
    Task<GrpcReturn<string>> CompleteMoveJob(ScMoveJob scNum);
}
